package com.mall.mapper;

import com.mall.model.po.Cart;
import com.mall.model.po.CartExample;
import java.util.List;

import com.mall.model.vo.CartVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CartMapper {

    long countByExample(CartExample example);

    int deleteByExample(CartExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    List<Cart> selectByExample(CartExample example);

    Cart selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByExample(@Param("record") Cart record, @Param("example") CartExample example);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    Cart selectByProductIdAndUserId(@Param("userId") Integer userId, @Param("productId") Integer productId);

    List<CartVo> selectCartsByUserId(Integer userId);

    void updateSelectStatus(@Param("userId") Integer userId, @Param("productId") Integer productId,@Param("selected") Integer selected);
}